package Control;

import java.awt.CardLayout;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.JFrame;
import server.SQLConnection;
import client.LibaryMain;
import Gui.EditDetails;
import Gui.Login;
import Gui.MainScreen;
import Gui.SubscriberWindow;
import Logic.Users;
import Gui.MainScreen;;
/**
 * this class is the the user subscriber controller
 * @author Ron Shenkerman
 * @author Gabi Revah
 * @author Aviad Almog
 * @author Ivan Onyshchenko
 */
public class UserSubscriber extends Users {
	
	private static final long serialVersionUID = 1L;

	public SubscriberWindow userWindow;

/**
 * 	create new instanse of subscriber 
 * @param get  userName
 * @param get password
 * @param get UserLevel
 * @param get connected
 */
	public UserSubscriber(String userName, String password, String UserLevel, Boolean connected) 
	{
		super(userName, password, UserLevel, connected);
		System.out.println("UserSubscriber constructor");
	}

	
/**
 * this method opens new subscriber window 
 */

	public void OpenWindow() {
		System.out.println("SubscriberWindow: Open Window");
		System.out.println("SubscriberWindow: " + super.getUserName());
		userWindow= new SubscriberWindow(super.getUserName(),this);
		
		MainScreen.card.add("SubscriberWindow", userWindow);
		MainScreen.cardLayot.show(MainScreen.card, "SubscriberWindow");
		
	}

	

}
